@extends('layouts.admin.application')
@section('content')

    <div class="admin-content">
        <div class="admin-content-body">
            <div class="am-cf am-padding am-padding-bottom-0">
                <div class="am-fl am-cf"><strong class="am-text-primary am-text-lg">顶部赠送项目</strong> /
                    <small>List</small>
                </div>
            </div>
            @include('admin._flash')
            <hr>

            <div class="am-g">
                <div class="am-u-sm-12 am-u-md-6">
                    <div class="am-btn-toolbar">
                        <div class="am-btn-group am-btn-group-xs">
                            <a href="/admin/topgoods/create" type="button" class="am-btn am-btn-default"><span
                                        class="am-icon-plus"></span> 新增</a>
                            <button type="button" class="am-btn am-btn-default delete_all"><span
                                        class="am-icon-trash-o"></span> 删除
                            </button>
                        </div>
                    </div>
                </div>
            </div>
            <hr>


            <div class="am-g">
                <div class="am-u-sm-12">
                    <form class="am-form">
                        <table class="am-table am-table-striped am-table-hover table-main">
                            <thead>
                            <tr>
                                <th><input class="check_all" type="checkbox"></th>
                                <th class="table-id">ID</th>

                                <th class="table-type">项目名称</th>
                                <th class="table-type">所属分类</th>


                                <th class="table-author" style="width:70px;">排序</th>
                                <th class="table-author" style="width:70px;">价格</th>



                                <th class="table-set">操作</th>
                            </tr>
                            </thead>
                            <tbody>
                            @foreach($goods as  $k=> $g)
                            <tr data-id="111">
                                <th><input class="checked_id" name="checked_id[]" value="" type="checkbox"></th>
                                <td>{{$k+1}}</td>
                                <td>{{$g->name}}</td>
                                <td>{{$g->pcates->name}}</td>


                                <td>
                                    <input type="text" class="stock" value="{{$g->sort}}"  style="width:60px">
                                </td>
                                <td>
                                    <input type="text" class="stock" value="{{$g->price}}元" style="width:80px">
                                </td>


                                <td>
                                    <div class="am-btn-toolbar">
                                        <div class="am-btn-group am-btn-group-xs">
                                            <a href="/admin/topgoods/{{$g->id}}/edit" class="am-btn am-btn-primary am-btn-xs"><span
                                                        class="am-icon-pencil-square-o"></span> 编辑
                                            </a>
                                            <a href="/admin/topgoods/{{$g->id}}"
                                               data-method="delete"
                                               data-token="{{csrf_token()}}" data-confirm="确认删除吗?"
                                               class="am-btn am-btn-danger am-btn-xs del_one">
                                                <span class="am-icon-trash-o"></span> 删除
                                            </a>
                                        </div>
                                    </div>
                                </td>
                            </tr>
                            @endforeach


                            </tbody>
                        </table>
                        共 {{$goods->total()}} 条记录

                        <div class="am-cf">
                            <div class="am-fr">
                                {{--{!! $cates->links() !!}--}}
                            </div>
                        </div>
                        <hr/>
                        <p>注：.....</p>
                    </form>
                </div>

            </div>
        </div>

        <footer class="admin-content-footer">
            <hr>
            <p class="am-padding-left">© 2014 AllMobilize, Inc. Licensed under MIT license.</p>
        </footer>

    </div>


@endsection